<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('题目列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>数据库编号：</label>
                                <input type="text" name="id"/>
                            </li>
                            <li>
                                <label>试题类型：</label>
                                <select name="type" th:with="type=${@dict.getType('school_problem_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>普通文本还是markdown：</label>
                                <select name="contentType" th:with="type=${@dict.getType('school_problem_content_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>关联章节编号：</label>
                                <input type="text" name="cId"/>
                            </li>
                            <li>
                                <label>关联知识点编号：</label>
                                <input type="text" name="kId"/>
                            </li>
                            <li>
                                <label>分数1：</label>
                                <input type="text" name="score1"/>
                            </li>
                            <li>
                                <label>分数2：</label>
                                <input type="text" name="score2"/>
                            </li>
                            <li>
                                <label>分数3：</label>
                                <input type="text" name="score3"/>
                            </li>
                            <li>
                                <label>分数4：</label>
                                <input type="text" name="score4"/>
                            </li>
                            <li>
                                <label>分数5：</label>
                                <input type="text" name="score5"/>
                            </li>
                            <li>
                                <label>分数6：</label>
                                <input type="text" name="score6"/>
                            </li>
                            <li>
                                <label>分数7：</label>
                                <input type="text" name="score7"/>
                            </li>
                            <li>
                                <label>分数8：</label>
                                <input type="text" name="score8"/>
                            </li>
                            <li>
                                <label>分数9：</label>
                                <input type="text" name="score9"/>
                            </li>
                            <li>
                                <label>分数10：</label>
                                <input type="text" name="score10"/>
                            </li>
                            <li>
                                <label>选项1A：</label>
                                <input type="text" name="option1"/>
                            </li>
                            <li>
                                <label>选项2B：</label>
                                <input type="text" name="option2"/>
                            </li>
                            <li>
                                <label>选项3C：</label>
                                <input type="text" name="option3"/>
                            </li>
                            <li>
                                <label>选项4D：</label>
                                <input type="text" name="option4"/>
                            </li>
                            <li>
                                <label>选项5E：</label>
                                <input type="text" name="option5"/>
                            </li>
                            <li>
                                <label>选项6F：</label>
                                <input type="text" name="option6"/>
                            </li>
                            <li>
                                <label>选项7G：</label>
                                <input type="text" name="option7"/>
                            </li>
                            <li>
                                <label>选项8H：</label>
                                <input type="text" name="option8"/>
                            </li>
                            <li>
                                <label>选项9I：</label>
                                <input type="text" name="option9"/>
                            </li>
                            <li>
                                <label>选项10J：</label>
                                <input type="text" name="option10"/>
                            </li>
                            <li>
                                <label>创建时间：</label>
                                <input type="text" class="time-input" placeholder="请选择创建时间" name="gmtCreate"/>
                            </li>
                            <li>
                                <label>修改时间：</label>
                                <input type="text" class="time-input" placeholder="请选择修改时间" name="gmtModified"/>
                            </li>
                            <li>
                                <label>创建人id：</label>
                                <input type="text" name="userId"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="school:problem:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="school:problem:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="school:problem:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="school:problem:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('school:problem:edit')}]];
        var removeFlag = [[${@permission.hasPermi('school:problem:remove')}]];
        var typeDatas = [[${@dict.getType('school_problem_type')}]];
        var contentTypeDatas = [[${@dict.getType('school_problem_content_type')}]];
        var prefix = ctx + "school/problem";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "题目",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '数据库编号',
                    visible: false
                },
                {
                    field: 'type',
                    title: '试题类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(typeDatas, value);
                    }
                },
                {
                    field: 'content',
                    title: '试题内容'
                },
                {
                    field: 'contentType',
                    title: '普通文本还是markdown',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contentTypeDatas, value);
                    }
                },
                {
                    field: 'cId',
                    title: '关联章节编号'
                },
                {
                    field: 'kId',
                    title: '关联知识点编号'
                },
                {
                    field: 'score1',
                    title: '分数1'
                },
                {
                    field: 'score2',
                    title: '分数2'
                },
                {
                    field: 'score3',
                    title: '分数3'
                },
                {
                    field: 'score4',
                    title: '分数4'
                },
                {
                    field: 'score5',
                    title: '分数5'
                },
                {
                    field: 'score6',
                    title: '分数6'
                },
                {
                    field: 'score7',
                    title: '分数7'
                },
                {
                    field: 'score8',
                    title: '分数8'
                },
                {
                    field: 'score9',
                    title: '分数9'
                },
                {
                    field: 'score10',
                    title: '分数10'
                },
                {
                    field: 'option1',
                    title: '选项1A'
                },
                {
                    field: 'option2',
                    title: '选项2B'
                },
                {
                    field: 'option3',
                    title: '选项3C'
                },
                {
                    field: 'option4',
                    title: '选项4D'
                },
                {
                    field: 'option5',
                    title: '选项5E'
                },
                {
                    field: 'option6',
                    title: '选项6F'
                },
                {
                    field: 'option7',
                    title: '选项7G'
                },
                {
                    field: 'option8',
                    title: '选项8H'
                },
                {
                    field: 'option9',
                    title: '选项9I'
                },
                {
                    field: 'option10',
                    title: '选项10J'
                },
                {
                    field: 'answer1',
                    title: '答案1'
                },
                {
                    field: 'answer2',
                    title: '答案2'
                },
                {
                    field: 'answer3',
                    title: '答案3'
                },
                {
                    field: 'answer4',
                    title: '答案4'
                },
                {
                    field: 'answer5',
                    title: '答案5'
                },
                {
                    field: 'answer6',
                    title: '答案6'
                },
                {
                    field: 'answer7',
                    title: '答案7'
                },
                {
                    field: 'answer8',
                    title: '答案8'
                },
                {
                    field: 'answer9',
                    title: '答案9'
                },
                {
                    field: 'answer10',
                    title: '答案10'
                },
                {
                    field: 'upload1',
                    title: '上传地址1'
                },
                {
                    field: 'upload2',
                    title: '上传地址2'
                },
                {
                    field: 'upload3',
                    title: '上传地址3'
                },
                {
                    field: 'gmtCreate',
                    title: '创建时间'
                },
                {
                    field: 'gmtModified',
                    title: '修改时间'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    field: 'userId',
                    title: '创建人id'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>